package com.aura.springbook.common.constant;

public class BookConstants {

    /**
     * 默认分页参数
     * <p>
     * 用于分页查询时的默认值设置
     */
    public static final int DEFAULT_PAGE = 1;
    public static final int DEFAULT_PAGE_SIZE = 10;
    public static final int MAX_PAGE_SIZE = 100;

    /**
     * 图书状态
     * <p>
     * 表示图书的当前状态
     */
    public static final String BOOK_STATUS_AVAILABLE = "available";
    public static final String BOOK_STATUS_BORROWED = "borrowed";

    /**
     * 响应消息
     * <p>
     * 操作成功时返回的标准消息
     */
    public static final String MSG_BOOK_BORROW_SUCCESS = "借阅成功";
    public static final String MSG_BOOK_RETURN_SUCCESS = "归还成功";
    public static final String MSG_BOOK_BORROW_FAIL = "借阅失败";
    public static final String MSG_BOOK_RETURN_FAIL = "归还失败";

    /**
     * 错误消息
     * <p>
     * 各种错误情况的标准提示信息
     */
    public static final String ERROR_BOOK_NOT_FOUND = "图书不存在";
    public static final String ERROR_BOOK_STOCK_EMPTY = "图书库存不足";
    public static final String ERROR_USER_NOT_FOUND = "用户不存在";
    public static final String ERROR_BORROW_RECORD_NOT_FOUND = "借阅记录不存在";

    /**
     * HTTP状态码
     * <p>
     * 常用的HTTP状态码常量
     */
    public static final int HTTP_STATUS_OK = 200;
    public static final int HTTP_STATUS_UNAUTHORIZED = 401;
    public static final int HTTP_STATUS_FORBIDDEN = 403;
    public static final int HTTP_STATUS_NOT_FOUND = 404;

    /**
     * 用户角色
     * <p>
     * 用户角色字符串常量，与UserRoleEnum对应
     */
    public static final String ROLE_USER = "USER";
    public static final String ROLE_ADMIN = "ADMIN";

    /**
     * 用于分页
     */
    public static final String SORT_ORDER = "descend";
}